----------------------------------------------------------------------------------
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output\table9.log
  log type:  text
 opened on:   3 Dec 2023, 18:19:06

. 
. use "$data/cpsmergeddata.dta", clear

. 
. *** total adults
. gen pop=(asecwt + spouseasecwt)

. egen totadults=sum(pop)

. drop pop

. 
. egen totkids=sum(newnumkidswt17)

. egen totdeeppoorkids=sum(newnumkidswt17*deeppoor)

. sum totdeeppoorkids

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
totdeeppoo~s |     26,546     3076243           0    3076243    3076243

. drop totdeeppoorkids 

. 
. ** total effect on poverty
. gen deeppooradults=(age>=18)*deeppoor*(asecwt+spouseasecwt)

. egen totdeeppooradults=sum(deeppooradults)

. 
. gen nolongerdeeppooradults=(age>=18)*deeppoor*(deeppoorctc21==0)*(asecwt+spousea
> secwt)

. egen totnolongerdeeppooradults=sum(nolongerdeeppooradults)

. 
. gen stilldeeppooradults=(age>=18)*deeppoor*(deeppoorctc21==1)*(asecwt+spouseasec
> wt)

. egen totstilldeeppooradults=sum(stilldeeppooradults)

. 
. 
. * row 1
. gen double group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(
> samplejustwomen==1)

. 
. gen double group1=asecwt*avgtax*.75*group

. egen totgroup1a=sum(group1)

. 
. gen double group2=asecwt*avgtax*.75*group*deeppoor

. egen totgroup2a=sum(group2)

. 
. gen double group3=asecwt*avgtax*.75*group*(deeppoor==0)

. egen totgroup3a=sum(group3)

. 
. gen double group4=asecwt*avgtax*.75*group*(deeppoor==0)*deeppoorctc21nother

. egen totgroup4a=sum(group4)

. 
. gen double group5=asecwt*avgtax*.75*group*(deeppoor==1)*(deeppoorctc21==0)*deepp
> oorctc21nother

. egen totgroup5a=sum(group5)

. 
. gen pov1=(deeppoor*group)/(group)
(23,056 missing values generated)

. gen pov2=(deeppoor*group*(deeppoorctc21==1))/(group)
(23,056 missing values generated)

. gen pov3=(deeppoor*group*(deeppoorctc21==1)+group4/asecwt+group5/asecwt)/(group)
(23,056 missing values generated)

. 
. egen pop=sum(group*asecwt)

. forvalues i=1/3{
  2.         egen povnum`i'a=sum(pov`i'*asecwt)
  3.         gen povrate`i'=povnum`i'a/pop
  4.         }

.         
. gen totgroup45a=totgroup4a+totgroup5a   

. sum pop totgroup1a totgroup2a totgroup45a povnum1a povnum2a povnum3a povrate1 po
> vrate2 povrate3

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
         pop |     26,546     5448138           0    5448138    5448138
  totgroup1a |     26,546    408557.1           0   408557.1   408557.1
  totgroup2a |     26,546       14249           0      14249      14249
 totgroup45a |     26,546     34894.1           0    34894.1    34894.1
    povnum1a |     26,546      302003           0     302003     302003
-------------+---------------------------------------------------------
    povnum2a |     26,546    144602.6           0   144602.6   144602.6
    povnum3a |     26,546    179496.7           0   179496.7   179496.7
    povrate1 |     26,546    .0554323           0   .0554323   .0554323
    povrate2 |     26,546    .0265417           0   .0265417   .0265417
    povrate3 |     26,546    .0329464           0   .0329464   .0329464

. sum avgtax if group==1 [aw=asecwt]

    Variable |     Obs      Weight        Mean   Std. dev.       Min        Max
-------------+-----------------------------------------------------------------
      avgtax |   3,490  5448137.84     .099987   .0412663          0   .2069162

. 
. di "pov % decrease="
pov % decrease=

. di (povnum1a-povnum3a)/povnum1a
.40564586

. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. * row 2
. gen double group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*
> (samplejustwomen==1)

. 
. gen double group1=asecwt*avgtax*.25*group

. egen totgroup1b=sum(group1)

. 
. gen double group2=asecwt*avgtax*.25*group*deeppoor

. egen totgroup2b=sum(group2)

. 
. gen double group3=asecwt*avgtax*.25*group*(deeppoor==0)

. egen totgroup3b=sum(group3)

. 
. gen double group4=asecwt*avgtax*.25*group*(deeppoor==0)*deeppoorctc21nother

. egen totgroup4b=sum(group4)

. 
. gen double group5=asecwt*avgtax*.25*group*(deeppoor==1)*(deeppoorctc21==0)*deepp
> oorctc21nother

. egen totgroup5b=sum(group5)

. 
. gen pov1=(deeppoor*group)/(group)
(25,243 missing values generated)

. gen pov2=(deeppoor*group*(deeppoorctc21==1))/(group)
(25,243 missing values generated)

. gen pov3=(deeppoor*group*(deeppoorctc21==1)+group4/asecwt+group5/asecwt)/(group)
(25,243 missing values generated)

. 
. egen pop=sum(group*asecwt)

. forvalues i=1/3{
  2.         egen povnum`i'b=sum(pov`i'*asecwt)
  3.         gen povrate`i'=povnum`i'b/pop
  4.         }

.         
. gen totgroup45b=totgroup4b+totgroup5b   

. sum pop totgroup1b totgroup2b totgroup45b povnum1b povnum2b povnum3b povrate1 po
> vrate2 povrate3

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
         pop |     26,546     1985433           0    1985433    1985433
  totgroup1b |     26,546    25003.57           0   25003.57   25003.57
  totgroup2b |     26,546     64.5163           0    64.5163    64.5163
 totgroup45b |     26,546    6890.029           0   6890.029   6890.029
    povnum1b |     26,546     3876.15           0    3876.15    3876.15
-------------+---------------------------------------------------------
    povnum2b |     26,546     3475.17           0    3475.17    3475.17
    povnum3b |     26,546     10365.2           0    10365.2    10365.2
    povrate1 |     26,546    .0019523           0   .0019523   .0019523
    povrate2 |     26,546    .0017503           0   .0017503   .0017503
    povrate3 |     26,546    .0052206           0   .0052206   .0052206

. sum avgtax if group==1 [aw=asecwt]

    Variable |     Obs      Weight        Mean   Std. dev.       Min        Max
-------------+-----------------------------------------------------------------
      avgtax |   1,303  1985432.72     .050374   .0244747          0     .20636

. 
. di "pov % decrease="
pov % decrease=

. di (povnum1b-povnum3b)/povnum1b
-1.6740966

. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. * row 3
. gen double group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(sampleju
> stwomen==1)

. 
. gen double group1=asecwt*avgtax*.25*group

. egen totgroup1c=sum(group1)

. 
. gen double group2=asecwt*avgtax*.25*group*deeppoor

. egen totgroup2c=sum(group2)

. 
. gen double group3=asecwt*avgtax*.25*group*(deeppoor==0)

. egen totgroup3c=sum(group3)

. 
. gen double group4=asecwt*avgtax*.25*group*(deeppoor==0)*deeppoorctc21nother

. egen totgroup4c=sum(group4)

. 
. gen double group5=asecwt*avgtax*.25*group*(deeppoor==1)*(deeppoorctc21==0)*deepp
> oorctc21nother

. egen totgroup5c=sum(group5)

. 
. gen pov1=(deeppoor*group)/(group)
(22,365 missing values generated)

. gen pov2=(deeppoor*group*(deeppoorctc21==1))/(group)
(22,365 missing values generated)

. gen pov3=(deeppoor*group*(deeppoorctc21==1)+group4/asecwt+group5/asecwt)/(group)
(22,365 missing values generated)

. 
. egen pop=sum(group*asecwt)

. forvalues i=1/3{
  2.         egen povnum`i'c=sum(pov`i'*asecwt)
  3.         gen povrate`i'=povnum`i'c/pop
  4.         }

. 
. gen totgroup45c=totgroup4c+totgroup5c   

. sum pop totgroup1c totgroup2c totgroup45c povnum1c povnum2c povnum3c povrate1 po
> vrate2 povrate3

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
         pop |     26,546     5882832           0    5882832    5882832
  totgroup1c |     26,546    95656.34           0   95656.34   95656.34
  totgroup2c |     26,546    2470.529           0   2470.529   2470.529
 totgroup45c |     26,546    3939.555           0   3939.555   3939.555
    povnum1c |     26,546    124925.4           0   124925.4   124925.4
-------------+---------------------------------------------------------
    povnum2c |     26,546    95359.28           0   95359.28   95359.28
    povnum3c |     26,546    99298.84           0   99298.84   99298.84
    povrate1 |     26,546    .0212356           0   .0212356   .0212356
    povrate2 |     26,546    .0162098           0   .0162098   .0162098
    povrate3 |     26,546    .0168794           0   .0168794   .0168794

. sum avgtax if group==1 [aw=asecwt]

    Variable |     Obs      Weight        Mean   Std. dev.       Min        Max
-------------+-----------------------------------------------------------------
      avgtax |   4,181   5882832.2     .065041   .0392817          0   .2086884

. 
. di "pov % decrease="
pov % decrease=

. di (povnum1c-povnum3c)/povnum1c
.20513498

. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. * row 4
. gen double group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*
> (samplejustwomen==1)

. 
. gen double group1=asecwt*newrtwchangespouse*.25*group

. egen totgroup1d=sum(group1)

. 
. gen double group2=asecwt*newrtwchangespouse*.25*group*deeppoor

. egen totgroup2d=sum(group2)

. 
. gen double group3=asecwt*newrtwchangespouse*.25*group*(deeppoor==0)

. egen totgroup3d=sum(group3)

. 
. gen double group4=asecwt*newrtwchangespouse*.25*group*(deeppoor==0)*deeppoorctc2
> 1notspouse

. egen totgroup4d=sum(group4)

. 
. gen double group5=asecwt*newrtwchangespouse*.25*group*(deeppoor==1)*(deeppoorctc
> 21==0)*deeppoorctc21notspouse

. egen totgroup5d=sum(group5)

. 
. gen pov1=(deeppoor*group)/(group)
(20,333 missing values generated)

. gen pov2=(deeppoor*group*(deeppoorctc21==1))/(group)
(20,333 missing values generated)

. gen pov3=(deeppoor*group*(deeppoorctc21==1)+group4/asecwt+group5/asecwt)/(group)
(20,333 missing values generated)

. 
. egen pop=sum(group*asecwt)

. forvalues i=1/3{
  2.         egen povnum`i'd=sum(pov`i'*asecwt)
  3.         gen povrate`i'=povnum`i'd/pop
  4.         }

.         
. gen totgroup45d=totgroup4d+totgroup5d   

. sum pop totgroup1d totgroup2d totgroup45d povnum1d povnum2d povnum3d povrate1 po
> vrate2 povrate3

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
         pop |     26,546     8750289           0    8750289    8750289
  totgroup1d |     26,546    172281.9           0   172281.9   172281.9
  totgroup2d |     26,546    2861.744           0   2861.744   2861.744
 totgroup45d |     26,546    19707.26           0   19707.26   19707.26
    povnum1d |     26,546    149713.1           0   149713.1   149713.1
-------------+---------------------------------------------------------
    povnum2d |     26,546     90894.9           0    90894.9    90894.9
    povnum3d |     26,546    110602.2           0   110602.2   110602.2
    povrate1 |     26,546    .0171095           0   .0171095   .0171095
    povrate2 |     26,546    .0103876           0   .0103876   .0103876
    povrate3 |     26,546    .0126398           0   .0126398   .0126398

. sum newrtwchangespouse if group==1 [aw=asecwt]

    Variable |     Obs      Weight        Mean   Std. dev.       Min        Max
-------------+-----------------------------------------------------------------
newrtwcha~se |   6,213  8750289.47    .0787548   .0427443          0   .2183175

. 
. di "pov % decrease="
pov % decrease=

. di (povnum1d-povnum3d)/povnum1d
.26123926

. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)

. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)
> *(married==1)

. 
. gen double group1=(asecwt*person1+spouseasecwt*person2)*avgtax*.25

. egen totgroup1e=sum(group1)

. 
. gen double group2=(asecwt*person1+spouseasecwt*person2)*avgtax*.25*deeppoor

. egen totgroup2e=sum(group2)

. 
. gen double group3=(asecwt*person1+spouseasecwt*person2)*avgtax*.25*(deeppoor==0)

. egen totgroup3e=sum(group3)

. 
. gen double group4=(asecwt*person1)*avgtax*.25*(deeppoor==0)*deeppoorctc21nother+
> (spouseasecwt*person2)*avgtax*.25*(deeppoor==0)*deeppoorctc21notspouse

. egen totgroup4e=sum(group4)

. 
. gen double group5=(asecwt*person1)*avgtax*.25*(deeppoor==1)*(deeppoorctc21==0)*d
> eeppoorctc21nother+spouseasecwt*person2*avgtax*.25*(deeppoor==1)*(deeppoorctc21=
> =0)*deeppoorctc21notspouse

. egen totgroup5e=sum(group5)

. 
. gen pov1=(deeppoor*(person1*asecwt+person2*spouseasecwt))

. gen pov2=(deeppoorctc21*(person1*asecwt+person2*spouseasecwt))

. gen pov3=(deeppoorctc21*(person1*asecwt+person2*spouseasecwt)+group4+group5)

. 
. egen pop=sum(asecwt*person1+spouseasecwt*person2)

. forvalues i=1/3{
  2.         egen povnum`i'e=sum(pov`i')
  3.         gen povrate`i'=povnum`i'e/pop
  4.         }

. 
. gen totgroup45e=totgroup4e+totgroup5e   

. sum pop totgroup1e totgroup2e totgroup45e povnum1e povnum2e povnum3e povrate1 po
> vrate2 povrate3

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
         pop |     26,546     1353110           0    1353110    1353110
  totgroup1e |     26,546     26314.4           0    26314.4    26314.4
  totgroup2e |     26,546    591.3316           0   591.3316   591.3316
 totgroup45e |     26,546    5095.786           0   5095.786   5095.786
    povnum1e |     26,546    30957.15           0   30957.15   30957.15
-------------+---------------------------------------------------------
    povnum2e |     26,546    21028.31           0   21028.31   21028.31
    povnum3e |     26,546     26124.1           0    26124.1    26124.1
    povrate1 |     26,546    .0228785           0   .0228785   .0228785
    povrate2 |     26,546    .0155407           0   .0155407   .0155407
    povrate3 |     26,546    .0193067           0   .0193067   .0193067

. sum newrtwchangespouse if person1 | person2 [aw=asecwt]

    Variable |     Obs      Weight        Mean   Std. dev.       Min        Max
-------------+-----------------------------------------------------------------
newrtwcha~se |     821  1342171.95    .0638883   .0343714          0   .1452145

. 
. di "pov % decrease="
pov % decrease=

. di (povnum1e-povnum3e)/povnum1e
.15612079

. drop pov1 pov2 pov3 povrate* group5 group* pop

. 
. gen pop=(asecwt*(incwage>0) + spouseasecwt*(totincwage>incwage))*(agi2017<80000)

. egen totpop=sum(pop)

. 
. forvalues i=1/2{
  2.         di totgroup`i'a+totgroup`i'b+totgroup`i'c+totgroup`i'd+totgroup`i'e
  3. }
727813.22
20237.116

. di totgroup4a+totgroup4b+totgroup4c+totgroup4d+totgroup4e+totgroup5a+totgroup5b+
> totgroup5c+totgroup5d+totgroup5e
70526.724

. 
. di totdeeppooradults
2082928.8

. di totstilldeeppooradults
1385415.3

. di (totstilldeeppooradults+totgroup4a+totgroup4b+2*totgroup4c+2*totgroup4d+totgr
> oup4e+totgroup5a+totgroup5b+2*totgroup5c+2*totgroup5d+totgroup5e)
1479588.8

. di totdeeppooradults/totadults
.03279578

. di totstilldeeppooradults/totadults
.02181341

. di (totstilldeeppooradults+totgroup4a+totgroup4b+2*totgroup4c+2*totgroup4d+totgr
> oup4e+totgroup5a+totgroup5b+2*totgroup5c+2*totgroup5d+totgroup5e)/totadults
.02329617

. di "pov % decrease="
pov % decrease=

. di (totdeeppooradults-(totstilldeeppooradults+totgroup4a+totgroup4b+2*totgroup4c
> +2*totgroup4d+totgroup4e+totgroup5a+totgroup5b+2*totgroup5c+2*totgroup5d+totgrou
> p5e))/totdeeppooradults
.28965944

. drop totgroup* povnum* person* pop totpop

. 
. 
. * KIDS 
. 
. drop stilldeeppoor totstilldeeppoor 

. 
. gen deeppoorkids=deeppoor*(newnumkidswt17)

. egen totdeeppoorkids=sum(deeppoorkids)

. di totdeeppoorkids
3076242.5

. 
. gen stilldeeppoor=deeppoor*(deeppoorctc21==1)*(newnumkidswt17)

. egen totstilldeeppoor=sum(stilldeeppoor)

. 
. di totkids
72975832

. di totdeeppoorkids
3076242.5

. di totstilldeeppoor
1714667.5

. 
. di totdeeppoorkids/totkids
.04215426

. di (totstilldeeppoor)/totkids
.02349637

. 
. * row 1
. gen double group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(
> samplejustwomen==1)

. 
. gen double group1=newnumkidswt17*avgtax*.75*group

. egen totgroup1a=sum(group1)

. gen double group2=newnumkidswt17*avgtax*.75*group*deeppoor

. egen totgroup2a=sum(group2)

. 
. gen double group3=newnumkidswt17*avgtax*.75*group*(deeppoor==0)

. egen totgroup3a=sum(group3)

. 
. gen double group4=newnumkidswt17*avgtax*.75*group*(deeppoor==0)*deeppoorctc21not
> her

. egen totgroup4a=sum(group4)

. 
. gen double group5=newnumkidswt17*avgtax*.75*group*(deeppoor==1)*(deeppoorctc21==
> 0)*deeppoorctc21nother

. egen totgroup5a=sum(group5)

. 
. gen pov1=(deeppoor*group)/(group)
(23,056 missing values generated)

. gen pov2=(deeppoor*group*(deeppoorctc21==1))/(group)
(23,056 missing values generated)

. gen pov3=(deeppoor*group*(deeppoorctc21==1)+group4/newnumkidswt17+group5/newnumk
> idswt17)/(group)
(23,056 missing values generated)

. 
. egen pop=sum(group*newnumkidswt17)

. forvalues i=1/3{
  2.         egen povnum`i'a=sum(pov`i'*newnumkidswt17)
  3.         gen povrate`i'=povnum`i'a/pop
  4.         }

. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. * row 2
. gen double group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*
> (samplejustwomen==1)

. 
. gen double group1=newnumkidswt17*avgtax*.25*group

. egen totgroup1b=sum(group1)

. 
. gen double group2=newnumkidswt17*avgtax*.25*group*deeppoor

. egen totgroup2b=sum(group2)

. 
. gen double group3=newnumkidswt17*avgtax*.25*group*(deeppoor==0)

. egen totgroup3b=sum(group3)

. 
. gen double group4=newnumkidswt17*avgtax*.25*group*(deeppoor==0)*deeppoorctc21not
> her

. egen totgroup4b=sum(group4)

. 
. gen double group5=newnumkidswt17*avgtax*.25*group*(deeppoor==1)*(deeppoorctc21==
> 0)*deeppoorctc21nother

. egen totgroup5b=sum(group5)

. 
. gen pov1=(deeppoor*group)/(group)
(25,243 missing values generated)

. gen pov2=(deeppoor*group*(deeppoorctc21==1))/(group)
(25,243 missing values generated)

. gen pov3=(deeppoor*group*(deeppoorctc21==1)+group4/newnumkidswt17+group5/newnumk
> idswt17)/(group)
(25,243 missing values generated)

. 
. egen pop=sum(group*newnumkidswt17)

. forvalues i=1/3{
  2.         egen povnum`i'b=sum(pov`i'*newnumkidswt17)
  3.         gen povrate`i'=povnum`i'b/pop
  4.         }

. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. * row 3
. gen double group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(sampleju
> stwomen==1)

. 
. gen double group1=newnumkidswt17*avgtax*.25*group

. egen totgroup1c=sum(group1)

. 
. gen double group2=newnumkidswt17*avgtax*.25*group*deeppoor

. egen totgroup2c=sum(group2)

. 
. gen double group3=newnumkidswt17*avgtax*.25*group*(deeppoor==0)

. egen totgroup3c=sum(group3)

. 
. gen double group4=newnumkidswt17*avgtax*.25*group*(deeppoor==0)*deeppoorctc21not
> her

. egen totgroup4c=sum(group4)

. 
. gen double group5=newnumkidswt17*avgtax*.25*group*(deeppoor==1)*(deeppoorctc21==
> 0)*deeppoorctc21nother

. egen totgroup5c=sum(group5)

. 
. gen pov1=(deeppoor*group)/(group)
(22,365 missing values generated)

. gen pov2=(deeppoor*group*(deeppoorctc21==1))/(group)
(22,365 missing values generated)

. gen pov3=(deeppoor*group*(deeppoorctc21==1)+group4/newnumkidswt17+group5/newnumk
> idswt17)/(group)
(22,365 missing values generated)

. 
. egen pop=sum(group*newnumkidswt17)

. forvalues i=1/3{
  2.         egen povnum`i'c=sum(pov`i'*newnumkidswt17)
  3.         gen povrate`i'=povnum`i'c/pop
  4.         }

. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. * row 4
. gen double group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*
> (samplejustwomen==1)

. 
. gen double group1=newnumkidswt17*newrtwchangespouse*.25*group

. egen totgroup1d=sum(group1)

. 
. gen double group2=newnumkidswt17*newrtwchangespouse*.25*group*deeppoor

. egen totgroup2d=sum(group2)

. 
. gen double group3=newnumkidswt17*newrtwchangespouse*.25*group*(deeppoor==0)

. egen totgroup3d=sum(group3)

. 
. gen double group4=newnumkidswt17*newrtwchangespouse*.25*group*(deeppoor==0)*deep
> poorctc21notspouse

. egen totgroup4d=sum(group4)

. 
. gen double group5=newnumkidswt17*newrtwchangespouse*.25*group*(deeppoor==1)*(dee
> ppoorctc21==0)*deeppoorctc21notspouse

. egen totgroup5d=sum(group5)

. 
. gen pov1=(deeppoor*group)/(group)
(20,333 missing values generated)

. gen pov2=(deeppoor*group*(deeppoorctc21==1))/(group)
(20,333 missing values generated)

. gen pov3=(deeppoor*group*(deeppoorctc21==1)+group4/newnumkidswt17+group5/newnumk
> idswt17)/(group)
(20,333 missing values generated)

. 
. egen pop=sum(group*newnumkidswt17)

. forvalues i=1/3{
  2.         egen povnum`i'd=sum(pov`i'*newnumkidswt17)
  3.         gen povrate`i'=povnum`i'd/pop
  4.         }

. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)

. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)
> *(married==1)

. 
. gen double group1=(newnumkidswt17*person1+newnumkidswt17*person2)*avgtax*.25

. egen totgroup1e=sum(group1)

. 
. gen double group2=(newnumkidswt17*person1+newnumkidswt17*person2)*avgtax*.25*dee
> ppoor

. egen totgroup2e=sum(group2)

. 
. gen double group3=(newnumkidswt17*person1+newnumkidswt17*person2)*avgtax*.25*(de
> eppoor==0)

. egen totgroup3e=sum(group3)

. 
. gen double group4=(newnumkidswt17*person1)*avgtax*.25*(deeppoor==0)*deeppoorctc2
> 1nother+(newnumkidswt17*person2)*avgtax*.25*(deeppoor==0)*deeppoorctc21notspouse

. egen totgroup4e=sum(group4)

. 
. gen double group5=(newnumkidswt17*person1)*avgtax*.25*(deeppoor==1)*(deeppoorctc
> 21==0)*deeppoorctc21nother+newnumkidswt17*person2*avgtax*.25*(deeppoor==1)*(deep
> poorctc21==0)*deeppoorctc21notspouse

. egen totgroup5e=sum(group5)

. 
. gen pov1=(deeppoor*(person1*newnumkidswt17+person2*newnumkidswt17))

. gen pov2=(deeppoorctc21*(person1*newnumkidswt17+person2*newnumkidswt17))

. gen pov3=(deeppoorctc21*(person1*newnumkidswt17+person2*newnumkidswt17)+group4+g
> roup5)

. 
. egen pop=sum(newnumkidswt17*person1+newnumkidswt17*person2)

. forvalues i=1/3{
  2.         egen povnum`i'e=sum(pov`i')
  3.         gen povrate`i'=povnum`i'e/pop
  4.         }

. 
. drop pov1 pov2 pov3 povrate* pop group5 group*

. 
. forvalues i=1/2{
  2.         di totgroup`i'a+totgroup`i'b+totgroup`i'c+totgroup`i'd+totgroup`i'e
  3. }
1565945.7
41635.173

. di totgroup4a+totgroup4b+totgroup4c+totgroup4d+totgroup4e+totgroup5a+totgroup5b+
> totgroup5c+totgroup5d+totgroup5e
110892

. 
. di totkids
72975832

. di totdeeppoorkids
3076242.5

. di totstilldeeppoor
1714667.5

. di (totstilldeeppoor+totgroup4a+totgroup4b+totgroup4c+totgroup4d+totgroup4e+totg
> roup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e)
1825559.5

. di totdeeppoorkids/totkids
.04215426

. di totstilldeeppoor/totkids
.02349637

. di (totstilldeeppoor+totgroup4a+totgroup4b+totgroup4c+totgroup4d+totgroup4e+totg
> roup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e)/totkids
.02501595

. di "pov % decrease="
pov % decrease=

. di (totdeeppoorkids-(totstilldeeppoor+totgroup4a+totgroup4b+totgroup4c+totgroup4
> d+totgroup4e+totgroup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e))/totdeeppoo
> rkids
.4065619

. drop totgroup* povnum* person*

. 
. log close
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output\table9.log
  log type:  text
 closed on:   3 Dec 2023, 18:19:07
----------------------------------------------------------------------------------
